<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
	
	<script src="${ctx}/js/controllers/store/storebanner/StoreBannerListController.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		var ctx = '${ctx}';
		setCtx(ctx);
	</script>
	 <div style="top:130px;position:fixed;height:30px;font-size: 14px;font-family: '微软雅黑';margin-left:-236px;">
				当前位置：${sessionScope.currcent_position}
          </div>
          <section>
              <section>
                <!--begin 搜索栏 -->
                <div class="panel" style="margin-top:23px;">
                 <div class="forword_area"></div>
					<div class="location">店铺装修信息</div>
	                  <div style="float:left;height: 28px;margin-left: 32px;margin-top: 2px;">
	                    <input id="title" type="text" maxlength="20" value="${(not empty title)? title : ''  }" class="input-sm" placeholder="标题">
	                  </div>
			             <div class="form-control" style="margin-left: 0">
			                 <div class="search" style="width:45px;margin-top: 2px;border-radius:0" onclick="getStoreBannerList();" >
			                 <img src="${ctx }/images/table/search_second.png" style="padding-top: 4px;padding-left: 6px;"></div>
			             </div>
                </div><!--end 搜索栏 -->

                <!--begin table表格 -->
                <div>
                <table class="table">
                    <thead>
                      <tr>
                      <th width="10%">装修图片</th>
                         <th width="10%">标题</th>
                        <th width="7%">对象类型</th>
                        <th width="15%">对象</th>
                         <th width="12%">备注说明</th> 
                        <th width="25%">操作</th>
                      </tr>
                    </thead>
                    <tbody id="tableTbody">
                      	<c:forEach items="${shopBanners.list }" var="shopBanner" varStatus="shopBannerStatus">
	                      <tr>
	                      <td>
	                      <div style="float: left;margin-left: 21px;">
							<c:if test="${shopBanner.img == null || shopBanner.img == ''}">
								<img width="70px" height="70px" src="${ctx}/images/store/shop_logo.jpg" />
							</c:if>
							<c:if test="${shopBanner.img != null && shopBanner.img != ''}">
								<img width="70px" height="70px" src="${sessionScope.image_logo}${shopBanner.img}" />
							</c:if>
							</div>
							</td>
	                        <td>${shopBanner.title}</td>
	                        <td>
	                        <c:choose>
	                        <c:when test="${shopBanner.objType == 1}">商品</c:when>
	                        <c:when test="${shopBanner.objType == 2}">特殊网页</c:when>
	                        <c:otherwise> </c:otherwise>
	                        </c:choose>
	                        </td>
	                        <td>
	                        <c:choose>
	                        <c:when test="${shopBanner.objType == 1}">
	                        <c:if test="${shopBanner.goodsLogo == null || shopBanner.goodsLogo == ''}">
									<img style="width:80px;height:80px;" title="快上传图片吧" src="${ctx}/images/seller/ad/goods_default.jpg" />
							</c:if>
							<c:if test="${shopBanner.goodsLogo != null && shopBanner.goodsLogo != ''}">
								<img style="width:80px;height:80px;" src="${sessionScope.image_logo}${shopBanner.goodsLogo}" />
							</c:if>
							<p style="float: right;">${shopBanner.goodsName}</p>
	                        </c:when>
	                        <c:when test="${shopBanner.objType == 2}"><a href="${shopBanner.url}" target="blank">${shopBanner.url}</a></c:when>
	                        <c:otherwise> </c:otherwise>
	                        </c:choose>
	                        </td>
	                       <td>${shopBanner.memo}</td> 
	                        <td >
                               <a class="fa fa-check " onclick="saveOrUpdate(${shopBanner.id});">
                            <img src="${ctx}/images/seller/ad/edit.png" style="margin-left:10px;">&nbsp;&nbsp;编辑</a>
                            <a class="fa fa-check " onclick="deleteStoreBanner(${shopBanner.id});">
                            <img src="${ctx}/images/seller/ad/delete.png" style="margin-left:10px;">&nbsp;&nbsp;删除</a>
                            <a class="fa fa-check " onclick="updateSort(${shopBanner.id});">
                            <img src="${ctx}/images/seller/ad/top.png" style="margin-left:10px;">&nbsp;&nbsp;置顶</a>
                              </td>
	                      </tr>
                      	</c:forEach>
                    </tbody>               
                                      
                    <tfoot>
		            	<tr>
			               <td colspan="6">
			                  <div>
			                    <%-- <div style="float:left;">
			                      <span class="total">合计 ${adInfo.total} 条数据</span>               
			                    </div> --%>
			                    <div style="float:right;  margin-right: 10px;margin-top: 29px"> 
				                  <div style="float:left;">                 
				                      <ul class="footer_ul">
				                      	<c:if test="${shopBanners.hasPreviousPage }">
				                        <li onclick="gotoPage(${currentPage-1 });"><a style="color:#37CED4">&lt;&lt;</a></li>
				                      	</c:if>
				                        <c:if test="${shopBanners.firstPage > 1}">
				                        	<li onclick="gotoPage(1);" style="border: 1px solid #9A9A9A;">
				                             	<a>1</a>
				                        	</li>
				                        	<c:if test="${shopBanners.firstPage > 2}">
				                        		...
				                        	</c:if>
				                      	</c:if>
				                        <c:forEach items="${shopBanners.navigatepageNums }" var="page">
				                        <li onclick="gotoPage(${page });" class="<c:if test="${currentPage == page }">active</c:if>" style="border: 1px solid #9A9A9A;">
				                             <a>${page}</a>
				                        </li>
				                        </c:forEach>
				                        <c:if test="${shopBanners.lastPage < shopBanners.pages}">
				                        	<c:if test="${shopBanners.firstPage < shopBanners.pages - 1}">
				                        		...
				                        	</c:if>
				                        	<li onclick="gotoPage(${shopBanners.pages});" style="border: 1px solid #9A9A9A;">
				                             	<a>${shopBanners.pages}</a>
				                        	</li>
				                      	</c:if>
				                        <c:if test="${shopBanners.hasNextPage }">
				                        <li><a onclick="gotoPage(${currentPage+1});" style="color:#37CED4">&gt;&gt;</a></li>
				                      	</c:if>
				                      </ul>
			                     </div>
		                   		<div style="float:left;  height: 28px;line-height: 28px;">
									<span style="color: #9A9A9A;">跳转到</span> 
									<input class="inputclass" id="pageNo" onkeydown="if(event.keyCode==13){event.keyCode=0;return false;}" type="text" value="${currentPage }" style="width:26px;height:26px" onkeyup = "checInputNum(this)">
									<span style="color: #9A9A9A;">页</span> 
									<span class="buttonclass" id="J_JumpTo" onclick="gotoStoreBannerPage(null);"><a>GO</a></span>
								</div>
			                 </div>
			                 </div>
							</td>
						</tr>
					</tfoot>
                  </table>
                  
                </div>
              </section>
            </section>
<script type="text/javascript">
</script>

<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>